<template>
  <div class="container">
    <h1 class="logo">XX影院</h1>

    <div class="search-container">
      <el-input
        v-model="searchText"
        placeholder="搜索电影、电视剧、综艺、动漫"
        class="input"
        @keyup.enter="handleSearch"
      >
        <template #append>
          <el-button
            class="search-btn"
            @click="handleSearch"
          >
            <el-icon size="24">
              <Search />
            </el-icon>
          </el-button>
        </template>
      </el-input>
    </div>
  </div>
</template>


<script setup>
import { ref } from 'vue'
import { Search } from '@element-plus/icons-vue'

const searchText = ref('')

const handleSearch = () => {
  // 处理搜索逻辑
  console.log('搜索内容：', searchText.value)
}
</script>

<style scoped>
.container {
  min-height: 30vh;
  background-color: #e6eaef;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 40px;
}

.logo {
  color: #39a1fa;
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 40px;
  font-family: Arial, sans-serif;
  letter-spacing: 2px;
}

.search-container {
  width: 60%;
  max-width: 800px;
}

:deep(.input .el-input__wrapper) {
  height: 56px;
  border-radius: 4px;
  background-color: rgba(255,255,255,0.15);
  box-shadow: none;
  border: none;
  padding: 0 20px;
}

:deep(.input .el-input__inner) {
  color: #2d2d2d;
  font-size: 16px;
  font-weight: 300;
}

:deep(.input .el-input__inner::placeholder) {
  color: #2277a4;
}

:deep(.search-btn) {
  height: 56px;
  width: 64px;
  background-color: #39a1fa !important;
  border: none !important;
  border-radius: 0 4px 4px 0 !important;
  transition: all 0.3s;
}

:deep(.search-btn:hover) {
  background-color: #0d60a8 !important;
}

:deep(.search-btn .el-icon) {
  color: white;
}

:deep(.el-input-group__append) {
  padding: 0;
  border: none;
  background: transparent;
}
</style>
